<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    <title>分类管理</title>
    <!--<link rel="stylesheet" type="text/css" href="http://hd.com/code/shopping/Static/bootstrap/css/bootstrap.min.css"/>-->
    <link rel="stylesheet" type="text/css" href="http://hd.com/code/shopping/Static/hdjs/hdjs.css"/>
    <script src="http://hd.com/code/shopping/Static/js/jquery-1.8.2.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="http://hd.com/code/shopping/Static/hdjs/hdjs.min.js" type="text/javascript" charset="utf-8"></script>
    <style type="text/css">
        a:hover{
        		text-decoration: none;
        }
        .page_hdcms{
            margin: 0 auto;
            margin: 20px 0 10px 0;
            text-align: center;
        }
        .page_hdcms a{
            padding: 3px 5px;
            margin-left: 3px;
            border: 1px solid #CCCCCC;   
        }
        .page_hdcms strong{
            padding: 3px 5px;
            margin-left: 3px;
            background: red;
            color: white;
        }
    </style>
</head>
<body>
<div class="wrap">
    <table class="hd-table hd-table-list">
        <thead>
        <tr fid=0>
            <td>属性id</td>
            <td>所属类型</td>
            <td>属性名称</td>
            <td>属性类别</td>
            <td>属性值</td>
            <td width="200">操作</td>
        </tr>
        </thead>
        <tbody>
        	<?php foreach ($data as $k=>$v){?>
	            <td><?php echo $v['attrid'];?></td>
	             <td><?php echo $v['name'];?></td>
	            <td><?php echo $v['title'];?></td>
	            <td>
	                    <?php if($v['type']==1){ ?>属性<?php }else{ ?>规格<?php } ?>
	            </td>
	            <td><?php echo $v['content'];?></td>
	            <td width="200">
					<a href="<?php echo U('edit',array('attrid'=>$v['attrid'],tid=>$_GET['tid']));?>" class="hd-btn hd-btn-primary hd-btn-xm">编辑</a>
					<a href="javascript:del_modal(<?php echo $v['attrid'];?>);" class="hd-btn hd-btn-danger hd-btn-xm">删除</a>
	            </td>
	        </tr>
	    <?php }?>
        </tbody>
    </table>
    <a href="<?php echo U('add',array(tid=>$_GET['tid']));?>" class="hd-btn hd-btn-success">添加属性</a>
    <div class="page_hdcms">
        <?php echo $page;?>
    </div>
</div>

</body>
<script type="text/javascript">
	function del_modal(attrid){
		hd_modal({
            width: 400,//宽度
            height: 120,//高度
            title: '确认删除吗？',//标题
            content: '',//提示信息
            button: true,//显示按钮
            button_success: "确定",//确定按钮文字
            button_cancel: "取消",//关闭按钮文字
            timeout: 0,//自动关闭时间 0：不自动关闭
            shade: true,//背景遮罩
            shadeOpacity: 0.3,//背景透明度
            success: function () {//点击确定后的事件
				location.href='<?php echo U("del");?>' + '&attrid=' + attrid;
//				location.href='<?php echo U("del");?>' + '&attrid=' + attrid +'&tid' + tid;
            },
            cancel: function () {//点击关闭后的事件

            }
        });
	}
</script>
</html>


